Index: /trunk/Ohana/src/addstar/src/find_matches.c
===================================================================
--- /trunk/Ohana/src/addstar/src/find_matches.c	(revision 28839)
+++ /trunk/Ohana/src/addstar/src/find_matches.c	(revision 28840)
@@ -247,10 +247,9 @@
     }
 
-    N = N1[i];
-    if (stars[N].found >= 0) continue;
-    if (!IN_REGION (stars[N].average.R, stars[N].average.D)) continue;
-
-    catalog[0].average[Nave].R         	   = stars[N].average.R;
-    catalog[0].average[Nave].D         	   = stars[N].average.D;
+    if (stars[i].found >= 0) continue;
+    if (!IN_REGION (stars[i].average.R, stars[i].average.D)) continue;
+
+    catalog[0].average[Nave].R         	   = stars[i].average.R;
+    catalog[0].average[Nave].D         	   = stars[i].average.D;
     catalog[0].average[Nave].dR        	   = 0;
     catalog[0].average[Nave].dD        	   = 0;
@@ -303,6 +302,5 @@
     for (j = 0; j < NSTAR_GROUP; j++) {
       // supply the measurments from this detection
-      catalog[0].measure[Nmeas]           = stars[N].measure;
-      N = N1[i + j];
+      catalog[0].measure[Nmeas]           = stars[i + j].measure;
 
       // the following measure elements cannot be set until here:
@@ -322,5 +320,5 @@
       /* next[Nmeas] should always be -1 in this context (it is always the only
          measurement for the star) */
-      stars[N].found = Nmeas;
+      stars[i].found = Nmeas;
       next_meas[Nmeas] = -1;  // initial value here update below
       Nmeas ++;
Index: /trunk/Ohana/src/addstar/src/find_matches_closest.c
===================================================================
--- /trunk/Ohana/src/addstar/src/find_matches_closest.c	(revision 28839)
+++ /trunk/Ohana/src/addstar/src/find_matches_closest.c	(revision 28840)
@@ -242,10 +242,9 @@
     }
 
-    N = N1[i];
-    if (stars[N].found >= 0) continue;
-    if (!IN_REGION (stars[N].average.R, stars[N].average.D)) continue;
-
-    catalog[0].average[Nave].R         	   = stars[N].average.R;
-    catalog[0].average[Nave].D         	   = stars[N].average.D;
+    if (stars[i].found >= 0) continue;
+    if (!IN_REGION (stars[i].average.R, stars[i].average.D)) continue;
+
+    catalog[0].average[Nave].R         	   = stars[i].average.R;
+    catalog[0].average[Nave].D         	   = stars[i].average.D;
     catalog[0].average[Nave].dR        	   = 0;
     catalog[0].average[Nave].dD        	   = 0;
@@ -297,6 +296,5 @@
     for (j = 0; j < NSTAR_GROUP; j++) {
         // supply the measurments from this detection
-        catalog[0].measure[Nmeas]           = stars[N].measure;
-        N = N1[i + j];
+        catalog[0].measure[Nmeas]           = stars[i + j].measure;
 
         // the following measure elements cannot be set until here:
@@ -316,5 +314,5 @@
         /* next[Nmeas] should always be -1 in this context (it is always the only
            measurement for the star) */
-        stars[N].found = Nmeas;
+        stars[i+j].found = Nmeas;
         next_meas[Nmeas] = -1;  // inital value here update below
         Nmeas ++;
