         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;
       }

{
  Tsdf tsdf;

  tsdf.volume = volume;
  tsdf.volume_size = volume_size;

  tsdf.intr = intr;

  tsdf.Rcurr_inv = Rcurr_inv;

    }

    __global__ void
    tsdf2 (PtrStep<short2> volume, const float tranc_dist_mm, const Mat33 Rcurr_inv, float3 tcurr,
           const Intr intr, const PtrStepSz<ushort> depth_raw, const float3 cell_size)
    {
      int x = threadIdx.x + blockIdx.x * blockDim.x;
