Index: trunk/ppBackground/src/ppBackgroundStackLoop.c
===================================================================
--- trunk/ppBackground/src/ppBackgroundStackLoop.c	(revision 36635)
+++ trunk/ppBackground/src/ppBackgroundStackLoop.c	(revision 36642)
@@ -76,4 +76,8 @@
       pmFPAview *view = pmFPAviewAlloc(0);
 
+      //      pmHDU *phu = pmFPAviewThisPHU(view, stack->fpa);
+      psF32 exptime = 1.0;
+      exptime = psMetadataLookupF32(NULL, stack->fpa->hdu->header, "EXPTIME");
+      
       // PART 1:
       // Determine the extent of the model map for this stack
@@ -124,6 +128,6 @@
       psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);
       psImageBinning *binning = psImageBinningAlloc();
-      binning->nXruff = 15; // Number of samples
-      binning->nYruff = 15; 
+      binning->nXruff = 13; // Number of samples
+      binning->nYruff = 13; 
       //    binning->nXfine = ceil(data->ra_max - data->ra_min) + 1; // This is the range we're looking at
       //    binning->nYfine = ceil(data->dec_max - data->dec_min) + 1;
@@ -169,5 +173,5 @@
 
       // This is where an iterative solution loop would likely start.
-      {
+      for (int iterator = 0; iterator < 2; iterator++) {
 	// Construct the offset information
 	printf("Model fit!\n");
@@ -298,5 +302,5 @@
 		psPlaneTransformApply(tp, stack->fpa->toTPA, pix);
 		
-		model->image->data.F32[y][x] = psImageMapEval(data->modelMap,tp->x,tp->y);
+		model->image->data.F32[y][x] = exptime * psImageMapEval(data->modelMap,tp->x,tp->y);
 		corr->image->data.F32[y][x] = readout->image->data.F32[y][x] + model->image->data.F32[y][x];
 		
