         continue;
 
       int newindex = v * w + u;
-      int new_nearest = data[newindex];
-      int new_y = new_nearest / w;
-      int new_x = new_nearest - new_y * w;
-      float new_w = (new_nearest < w * h) ? occupancy[new_nearest] : 0.0f;
-      float new_dist =
-          sqrtf(float((x - new_x) * (x - new_x) + (y - new_y) * (y - new_y))) -
-          new_w;
-
-      if (new_dist < cur_dist || cur_nearest >= w * h)
+      int newNearest = data[newindex];
+      int newY = newNearest / w;
+      int newX = newNearest - newY * w;
+      float newW = (newNearest < w * h) ? occupancy[newNearest] : 0.0f;
+      float newDistance =
+          sqrtf(float((x - newX) * (x - newX) + (y - newY) * (y - newY))) -
+          newW;
+
+      if (newDistance < currentDistance || currentNearest >= w * h)
       {
-        cur_dist = new_dist;
-        cur_nearest = new_nearest;
+        currentDistance = newDistance;
+        currentNearest = newNearest;
       }
     }
   }
 
-  data[index] = cur_nearest;
+  data[index] = currentNearest;
 }
 
 __global__ void /*__launch_bounds__(16)*/ jfa_thrust_gather(int imageSize,

  // voronoi diagram computation in thrust
  {
    // compute_temp_vector = compute_vector;
    jfa_cuda << <dimGrid, dimBlock>>>
        (thrust::raw_pointer_cast(compute_vector.data()), 1, image_size,
         image_size);
    // compute_vector.swap(compute_temp_vector);

    // cudaThreadSynchronize();
    for (int k = (image_size / 2); k > 0; k /= 2)
    {
      jfa_cuda<<<dimGrid, dimBlock>>>(
          thrust::raw_pointer_cast(compute_vector.data()), k, image_size,
          image_size);
      // cudaThreadSynchronize();


  int index = y * w + x;

  int currentNearest = data[index];
  int currentY = currentNearest / w;
  int currentX = currentNearest - currentY * w;
  float curr_w = (currentNearest < w * h) ? occupancy[currentNearest] : 0.0f;

  float currentDistance =
      sqrtf(float((x - currentX) * (x - currentX) + (y - currentY) * (y - currentY))) -
      curr_w;

#pragma unroll
