 
   int i, j, k, h, jc0, jc1, jtodo;
   long long key;
-  int cnt, ival, icat, lastival;
-  int ccnt, ctot, cnew, bestival, tmp;
-  float update, tmpx, clogc, impty, minimpty, lastimpty;
+  int ccnt, ctot, cnew, cnt, ival, icat, lastival, bestival, tmp;
+  float update, cacc, impty, minimpty, lastimpty, tmpx;
 
   for (i = threadIdx.y + blockDim.y * blockIdx.x; i < ntrees*nnodes*nsamps; i += blockDim.y * gridDim.x) {
     // Process a group with fixed itree, inode, and ifeat

        lastival = tmp;
        lastimpty = tmpx;
      }
      if (ival == lastival) lastimpty = -1e7f;            // Eliminate values which are not at value boundaries
      if (lastimpty < minimpty) {
        minimpty = lastimpty;
        bestival = lastival;



    lastival = -1;
    lastimpty = 1e7f;
    minimpty = 1e7f;
    ctot = 0;
    cacc = 0.0f;
    for (j = jc0; j < jc1; j += blockDim.x) {
      if (j + threadIdx.x < jc1) {                         // Read a block of (32) keys and counts
        key = keys[j + threadIdx.x];                       // Each (x) thread handles a different input
