 	{
 		maxval = hIntensity[k];
 		maxint = hIntensity2[k];
-<		maxidx = k;
+		maxidx = k;
 	}
 	if (hIntensity[k] < minval) minval = hIntensity[k];
 }

__device__ likelihood getObjects(idealsphere& myspherer, unsigned int tx, unsigned int ty, unsigned int zval, unsigned int bx, unsigned int by, float lsum, float psum)
{
  myspherer.r = exp(myspherer.roffset + (zval) * myspherer.rfactor);
  myspherer.offsetx = (tx) * 2 + myspherer.baseoffsetx;
  myspherer.offsety = (ty * 2 + myspherer.baseoffsety);
  myspherer.extrax = bx;
  myspherer.extray = by;
  //myspherer.lfactor = 0.25 / sqrt(lsum) * (((int) bx 0)) + 1.0;

	}
      
//      if (psum - lsum < 2500) continue;
      dim3 grid(1, 1, 2700);
      dim3 block(32, 32, 1);

      spherer.rfactor = 0.0025;
      spherer.roffset = -10;
      spherer.baseoffsetx = NX / 2 - 10 - 15 - 0.5; // good val -10
      spherer.baseoffsety = NY / 2 + 10 - 11 - 0.5; // good val +10
      dPhotons.assign(photonVals.data(), photonVals.data() + NY * NX);
      dLambdas.assign(lambdaVals.data(), lambdaVals.data() + NY * NX);
