         //node_y = min(node_y, yh-node_size_y);
 
         // x direction
-        int bin_index_xl = int((node_x-xl)/bin_size_x);
+        int bin_index_xl = int((node_x - xl) / bin_size_x);
         bin_index_xl = max(bin_index_xl, 0);
-        int k = bin_index_xl+int(residual_index / num_impacted_bins_y);
-        if (k+1 > num_bins_x || node_x+node_size_x <= bin_center_x_tensor[k]-bin_size_x/2)
+        int k = bin_index_xl + int(residual_index / num_impacted_bins_y);
+        if (k + 1 > num_bins_x || node_x + node_size_x <= bin_center_x_tensor[k] - bin_size_x / 2)
         {
             return;
         }
         // y direction
-        int bin_index_yl = int((node_y-yl)/bin_size_y);
+        int bin_index_yl = int((node_y - yl) / bin_size_y);
         bin_index_yl = max(bin_index_yl, 0);
-        int h = bin_index_yl+(residual_index % num_impacted_bins_y);
-        if (h+1 > num_bins_y || node_y+node_size_y <= bin_center_y_tensor[h]-bin_size_y/2)
+        int h = bin_index_yl + (residual_index % num_impacted_bins_y);
+        if (h + 1 > num_bins_y || node_y + node_size_y <= bin_center_y_tensor[h] - bin_size_y / 2)
         {
             return;
         }

                            x_tensor[i], y_tensor[i], x_tensor[i]+node_size_x_tensor[i], y_tensor[i]+node_size_y_tensor[i]
                          );
                }
#endif

            }
        }
    }
}

template <typename T>
int computeElectricForceCudaLauncher(
        int num_bins_x, int num_bins_y,
        int num_movable_impacted_bins_x, int num_movable_impacted_bins_y,
        int num_filler_impacted_bins_x, int num_filler_impacted_bins_y,
        const T* field_map_x_tensor, const T* field_map_y_tensor,
        const T* x_tensor, const T* y_tensor,
        const T* node_size_x_tensor, const T* node_size_y_tensor,
        const T* bin_center_x_tensor, const T* bin_center_y_tensor,
        T xl, T yl, T xh, T yh,
        T bin_size_x, T bin_size_y,
        int num_nodes, int num_movable_nodes, int num_filler_nodes,
        T* grad_x_tensor, T* grad_y_tensor
        )
{
    int thread_count = 512;


    cudaError_t status;
    cudaStream_t stream_movable;

            {
                T py = computeDensityFunc(node_y, node_size_y, bin_center_y_tensor[h], bin_size_y);

                T area = px * py * ratio;

                tmp_x += area * field_map_x_tensor[k * num_bins_y + h];
                tmp_y += area * field_map_y_tensor[k * num_bins_y + h];

                #if 0
                if (i == 0)
                {
                    printf("bin[%d, %d] (%g, %g, %g, %g) add cell %d den (%g, %g, %g, %g) %g, x %g, y %g orig (%g, %g, %g, %g)\n",
