Index: trunk/magic/remove/src/Line.c
===================================================================
--- trunk/magic/remove/src/Line.c	(revision 24998)
+++ trunk/magic/remove/src/Line.c	(revision 25001)
@@ -444,9 +444,5 @@
                 if (y >= 0 && y < numRows)
                 {
-                    pixel = psAlloc (sizeof(PixelPos));
-                    pixel->x = (unsigned int) x;
-                    pixel->y = (unsigned int) y;
-                    psArrayAdd (pixels, 1024, pixel);
-                    psFree (pixel);
+                    psImageSet(pixels, x, y, 1);
                 }
             }
@@ -494,9 +490,5 @@
                 if (x >=0 && x < numCols)
                 {
-                    pixel = psAlloc (sizeof(PixelPos));
-                    pixel->x = (unsigned int) x;
-                    pixel->y = (unsigned int) y;
-                    psArrayAdd (pixels, 1024, pixel);
-                    psFree (pixel);
+                    psImageSet(pixels, x, y, 1);
                 }
             }
Index: trunk/magic/remove/src/streaksextern.c
===================================================================
--- trunk/magic/remove/src/streaksextern.c	(revision 24998)
+++ trunk/magic/remove/src/streaksextern.c	(revision 25001)
@@ -34,5 +34,6 @@
     int i;
     Line line;
-    StreakPixels *pixels = psArrayAllocEmpty (1024);
+    StreakPixels *pixels = psImageAlloc(numCols, numRows, PS_TYPE_U8);
+    psImageInit(pixels, 0);
     int streaksOnComponent = 0;
 
Index: trunk/magic/remove/src/streaksextern.h
===================================================================
--- trunk/magic/remove/src/streaksextern.h	(revision 24998)
+++ trunk/magic/remove/src/streaksextern.h	(revision 25001)
@@ -4,5 +4,5 @@
 /** psLib includes */
 
-#include "psArray.h"
+#include "psImage.h"
 
 /** streakremove includes */
@@ -36,5 +36,5 @@
 /** For now, use psArray to define a list of PixelPos pointers */
 
-typedef psArray StreakPixels;
+typedef psImage StreakPixels;
 
 /** Create a list of pixel positions from a Streaks pointer list
Index: trunk/magic/remove/src/streaksremove.c
===================================================================
--- trunk/magic/remove/src/streaksremove.c	(revision 24998)
+++ trunk/magic/remove/src/streaksremove.c	(revision 25001)
@@ -13,5 +13,5 @@
 static bool readAndCopyToOutput(streakFiles *sf, bool exciseAll);
 static void exciseNonWarpedPixels(streakFiles *sfiles, double newMaskValue);
-static bool warpedPixel(streakFiles *sfiles, PixelPos *cellCoord);
+static bool warpedPixel(streakFiles *sfiles, int x, int y);
 static void excisePixel(streakFiles *sfiles, unsigned int x, unsigned int y, bool streak, double newMaskValue);
 static void writeImages(streakFiles *sf, bool exciseImageCube);
@@ -146,21 +146,20 @@
                 }
 
-                totalStreakPixels +=  psArrayLength(pixels);
 
                 psTimerStart("REMOVE_STREAKS");
 
-                // for each pixel covered by the streak
-                for (int i = 0; i < psArrayLength (pixels); ++i) {
-                    PixelPos *pixelPos = psArrayGet (pixels, i);
-
-                    // if this pixel was not part of the warp, skip because it has already been
-                    // excised (unless we weren't asked to check)
-                    if (!checkNonWarpedPixels || warpedPixel(sfiles, pixelPos)) {
-
-                        excisePixel(sfiles, pixelPos->x, pixelPos->y, true, maskStreak);
-
-                    } else {
-                        // This pixel was not included in any warp and has thus already excised
-                        // by exciseNonWarpedPixels
+                for (int y=0 ; y < sfiles->inImage->numRows; y++) {
+                    for (int x = 0; x < sfiles->inImage->numCols; x++) {
+                        if (psImageGet(pixels, x, y)) {
+                            ++totalStreakPixels;
+                            if (!checkNonWarpedPixels || warpedPixel(sfiles, x, y)) {
+
+                                excisePixel(sfiles, x, y, true, maskStreak);
+
+                            } else {
+                                // This pixel was not included in any warp and has thus already excised
+                                // by exciseNonWarpedPixels
+                            }
+                        }
                     }
                 }
@@ -178,5 +177,4 @@
                 exciseImageCube = true;
             }
-            psArrayElementsFree (pixels);
             psFree(pixels);
         }
@@ -756,5 +754,5 @@
 
 static bool
-warpedPixel(streakFiles *sfiles, PixelPos *cellCoord)
+warpedPixel(streakFiles *sfiles, int x, int y)
 {
     PixelPos chipCoord;
@@ -767,10 +765,10 @@
     // we clip so that the streak calculation code doesn't have to
     // clipping here insures that we don't touch the overscan regions
-    if ((cellCoord->x < 0) || (cellCoord->x >= sfiles->inImage->numCols) ||
-        (cellCoord->y < 0) || (cellCoord->y >= sfiles->inImage->numRows)) {
+    if ((x < 0) || (x >= sfiles->inImage->numCols) ||
+        (y < 0) || (y >= sfiles->inImage->numRows)) {
         return false;
     }
 
-    cellToChipInt(&chipCoord.x, &chipCoord.y, sfiles->astrom, cellCoord->x, cellCoord->y);
+    cellToChipInt(&chipCoord.x, &chipCoord.y, sfiles->astrom, x, y);
 
     if (chipCoord.x < 0 || chipCoord.x >= sfiles->warpedPixels->numCols) {
@@ -838,5 +836,4 @@
         }
     }
-
 
     // get rid of unused elements (don't know if this is necessary)
