Index: /trunk/Ohana/src/addstar/src/SkyListForStars.c
===================================================================
--- /trunk/Ohana/src/addstar/src/SkyListForStars.c	(revision 6640)
+++ /trunk/Ohana/src/addstar/src/SkyListForStars.c	(revision 6641)
@@ -4,5 +4,5 @@
   
   int i, j, Nr, NR;
-  SkyRegion *region;
+  SkyList *here;
   SkyList *list;
   
@@ -11,4 +11,5 @@
   ALLOCATE (list, SkyList, 1);
   ALLOCATE (list[0].regions,  SkyRegion *, NR);
+  ALLOCATE (list[0].filename, char *, NR);
   list[0].Nregions = Nr;
 
@@ -16,16 +17,23 @@
   for (i = 0; i < Nstars; i++) {
     if (stars[i].found) continue;
-    region = SkyRegionByPoint (table, depth, stars[i].R, stars[i].D);
+    here = SkyRegionByPoint (table, depth, stars[i].R, stars[i].D);
     stars[i].found = TRUE;
     /* search forward for all contained stars */
     for (j = i; j < Nstars; j++) {
-      if (stars[j].R >= region[0].Rmax) break;
-      if (stars[j].D <  region[0].Dmin) continue;
-      if (stars[j].D >= region[0].Dmax) continue;
+      if (stars[j].R >= here[0].regions[0][0].Rmax) break;
+      if (stars[j].R <  here[0].regions[0][0].Rmin) break;
+      if (stars[j].D <  here[0].regions[0][0].Dmin) continue;
+      if (stars[j].D >= here[0].regions[0][0].Dmax) continue;
       stars[j].found = TRUE;
     }
-    list[0].regions[Nr] = region;
+    list[0].regions[Nr] = here[0].regions[0];
+    list[0].filename[Nr] = here[0].filename[0];
+    SkyListFree (here, FALSE); 
     Nr ++;
-    CHECK_REALLOCATE (list[0].regions, SkyRegion *, NR, Nr, 100);
+    if (Nr >= NR) {
+	NR += 32;
+	REALLOCATE (list[0].regions, SkyRegion *, NR);
+	REALLOCATE (list[0].filename, char *, NR);
+    }
     list[0].Nregions = Nr;
   }
Index: /trunk/Ohana/src/addstar/src/get2mass.c
===================================================================
--- /trunk/Ohana/src/addstar/src/get2mass.c	(revision 6640)
+++ /trunk/Ohana/src/addstar/src/get2mass.c	(revision 6641)
@@ -94,6 +94,9 @@
 
     Nregions ++;
-    CHECK_REALLOCATE (regions, SkyRegion, NREGIONS, Nregions, 20);
-    CHECK_REALLOCATE (filenames, char *, NREGIONS, Nregions, 20);
+    if (Nregions >= NREGIONS) {
+	NREGIONS += 20;
+	REALLOCATE (regions, SkyRegion, NREGIONS);
+	REALLOCATE (filenames, char *, NREGIONS);
+    }
   }    
   fclose (f);
Index: /trunk/Ohana/src/addstar/src/rfits.c
===================================================================
--- /trunk/Ohana/src/addstar/src/rfits.c	(revision 6640)
+++ /trunk/Ohana/src/addstar/src/rfits.c	(revision 6641)
@@ -40,2 +40,5 @@
   return (NULL);
 }
+
+// **** this needs to be fixed to handle MEF smp files...
+// there will be multiple extension names, how will these get passed?
