         float3 coo = make_float3 (x, y, z);
         coo += 0.5f;         //shift to cell center;
 
-        coo.x *= volume_size.x / VOLUME_X;
-        coo.y *= volume_size.y / VOLUME_Y;
-        coo.z *= volume_size.z / VOLUME_Z;
+        coo.x *= cell_size.x;
+        coo.y *= cell_size.y;
+        coo.z *= cell_size.z;
 
         return coo;
       }

  dim3 grid (divUp (VOLUME_X, block.x), divUp (VOLUME_Y, block.y));

#if 0
  //float3 cell_size;
  //cell_size.x = volume_size.x / VOLUME_X;
  //cell_size.y = volume_size.y / VOLUME_Y;
  //cell_size.z = volume_size.z / VOLUME_Z;
  //tsdf2<<<grid, block>>>(volume, volume_size, tranc_dist, Rcurr_inv, tcurr, intr, depth_raw, cell_size);
  else
    integrateTsdfKernel<<<grid, block>>>(tsdf);
#endif
  cudaSafeCall ( cudaGetLastError () );
  cudaSafeCall (cudaDeviceSynchronize ());

{
  Tsdf tsdf;

  tsdf.volume = volume;  
  tsdf.cell_size.x = volume_size.x / VOLUME_X;
  tsdf.cell_size.y = volume_size.y / VOLUME_Y;
  tsdf.cell_size.z = volume_size.z / VOLUME_Z;
  
  tsdf.intr = intr;

  tsdf.Rcurr_inv = Rcurr_inv;
