Index: /trunk/psphot/src/psphotReadout.c
===================================================================
--- /trunk/psphot/src/psphotReadout.c	(revision 10204)
+++ /trunk/psphot/src/psphotReadout.c	(revision 10205)
@@ -95,11 +95,16 @@
 
     // replace fitted sources
-    psphotReplaceUnfit (sources);
+    // XXX we need to replace failed objects, not all objects
+    // psphotReplaceUnfit (sources);
 
     // XXX find remaining peaks after first source subtraction pass
     // psphotFindPeaks ();
 
+    // replace subtracted sources
+    psphotReplaceAll (sources);
+    psphotSaveImage (NULL, readout->image,  "replace.fits");
+
     // linear PSF fit to remaining peaks
-    // psphotEnsemblePSF (readout, sources, recipe, psf, TRUE);
+    psphotEnsemblePSF (readout, sources, recipe, psf, TRUE);
 
 finish:
