Index: trunk/Ohana/src/addstar/src/find_matches_refstars.c
===================================================================
--- trunk/Ohana/src/addstar/src/find_matches_refstars.c	(revision 39305)
+++ trunk/Ohana/src/addstar/src/find_matches_refstars.c	(revision 39306)
@@ -22,5 +22,9 @@
   ALLOCATE (N1, off_t,  srccat->Naverage);
 
-  myAbort ("figure out if found_t needs to be tracking Naverage or Nmeasure"); 
+  // found_t[] has the following values:
+  // -1: not found
+  // -2: found on another catalog
+  //  1: found (we used to use Nmeas, but we are now matching by star not measure
+
   if (!srccat->found_t) {
     ALLOCATE (srccat->found_t, off_t, srccat->Naverage);
@@ -218,10 +222,10 @@
 	/** don't update average / secfilt values for REF photcodes **/
 
-	myAbort ("fix logic on multiple detections");
-
 	/*** flag multiple stars */
+	/* this code is a bit too crude */
 	/* this image star matches more than one tgtcat star */
+	/* here found_t[N] = tgtcat.measure[N] */
 	if (srccat->found_t[N] > -1) {
-	  tgtcat[0].measure[srccat->found_t[N]].dbFlags |= ID_MEAS_BLEND_MEAS;
+	  // tgtcat[0].measure[srccat->found_t[N]].dbFlags |= ID_MEAS_BLEND_MEAS; 
 	  tgtcat[0].measure[Nmeas].dbFlags |= ID_MEAS_BLEND_MEAS;
 	} 
@@ -230,12 +234,12 @@
 	} 
 	if (srccat->found_t[N] == -1) { /* this image star matches only this tgtcat star */
-	  srccat->found_t[N] = Nmeas;  /* save first match, in case coincidences are found */
+	  srccat->found_t[N] = 1;  /* save first match, in case coincidences are found */
 	}
 	/* this tgtcat star matches more than one image star */
 	if (tgtcat[0].found_t[n] > -1) {
-	  tgtcat[0].measure[tgtcat[0].found_t[n]].dbFlags |= ID_MEAS_BLEND_OBJ;
+	  // tgtcat[0].measure[tgtcat[0].found_t[n]].dbFlags |= ID_MEAS_BLEND_OBJ;
 	  tgtcat[0].measure[Nmeas].dbFlags |= ID_MEAS_BLEND_OBJ;
 	} else {
-	  tgtcat[0].found_t[n] = Nmeas;
+	  tgtcat[0].found_t[n] = 1;
 	}
 	tgtcat[0].average[n].Nmeasure ++;
@@ -321,5 +325,5 @@
       /* next[Nmeas] should always be -1 in this context (it is always the only
 	 measurement for the star) */
-      srccat->found_t[i] = Nmeas;
+      srccat->found_t[i] = 1;
       Nmeas ++;
 
