Index: trunk/Ohana/src/opihi/dvo/find_matches.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/find_matches.c	(revision 40580)
+++ trunk/Ohana/src/opihi/dvo/find_matches.c	(revision 40581)
@@ -213,6 +213,28 @@
   for (i = 0; i < Npoints; i++) {
     inCatalog[i] = FALSE;
-    if (RAvec->elements.Flt[i] < Rmin) continue;
-    if (RAvec->elements.Flt[i] > Rmax) continue;
+
+    // we need to worry about points near the 0,360 boundary.  I have expanded Rmin and
+    // Rmax to account for the RADIUS.  if I have a region which is close to the boundary,
+    // then: Rmin < 0 or Rmax > 360.  if so, check on the other side as well
+
+    int altTest = FALSE;
+    double Rnorm = ohana_normalize_angle (RAvec->elements.Flt[i]);
+    if ((Rmax > 360.0) && (Rnorm < 180.0)) {
+      double Rtest = Rnorm + 360.0;
+      if (Rtest < Rmin) continue;
+      if (Rtest > Rmax) continue;
+      altTest = TRUE;
+    }
+    if ((Rmin < 0.0) && (Rnorm > 180.0)) {
+      double Rtest = Rnorm - 360.0;
+      if (Rtest < Rmin) continue;
+      if (Rtest > Rmax) continue;
+      altTest = TRUE;
+    }
+    if (!altTest) {
+      if (Rnorm < Rmin) continue;
+      if (Rnorm > Rmax) continue;
+    }
+
     if (DECvec->elements.Flt[i] < Dmin) continue;
     if (DECvec->elements.Flt[i] > Dmax) continue;
Index: trunk/Ohana/src/opihi/dvo/skyregion.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/skyregion.c	(revision 40580)
+++ trunk/Ohana/src/opihi/dvo/skyregion.c	(revision 40581)
@@ -186,10 +186,11 @@
   list->regions[Nout] = input->regions[0];
   list->filename[Nout] = input->filename[0];
+  Nout ++;
 
   for (int i = 0; i < input->Nregions; i++) {
-    if (list->regions[Nout][0].index == input->regions[i][0].index) continue;
-    Nout ++;
+    if (list->regions[Nout-1][0].index == input->regions[i][0].index) continue;
     list->regions[Nout] = input->regions[i];
     list->filename[Nout] = input->filename[i];
+    Nout ++;
   }
   list->Nregions = Nout;
@@ -249,8 +250,8 @@
     // scan over the remaining points to find any that lie within these regions
     // if we sorted the ra,dec inputs we could break out of this more quickly
-    for (int j = i + 1; j < Npts; j++) {
+    for (int j = i + 1; FALSE && (j < Npts); j++) {
       ra = RA->elements.Flt[j];
       dec = DEC->elements.Flt[j];
-      for (int n = 0; !found[j] && (n < new->Nregions); n++) {
+      for (int n = 0; n < new->Nregions; n++) {
 	if (ra  < new[0].regions[n][0].Rmin) continue;
 	if (ra  > new[0].regions[n][0].Rmax) continue;
