     divergence_kernel <<< dimGrid, dimBlock >>> ( dev_grad_x, dev_grad_y, dev_grad_z, dev_interm);
     cudaDeviceSynchronize();
     CUDA_CHECK_ERROR;
-    std::cout << "Done computing divergence" << std::endl;
+//    std::cout << "Done computing divergence" << std::endl;
     subtract_kernel <<< dimGrid, dimBlock >>> ( dev_in, dev_interm, dev_out);
     cudaDeviceSynchronize();
     CUDA_CHECK_ERROR;
-    std::cout << "Done subtracting" << std::endl;
+//    std::cout << "Done subtracting" << std::endl;
     multiply_by_beta_kernel <<< dimGrid, dimBlock >>> ( dev_out, dev_interm, beta);
     cudaDeviceSynchronize();
     CUDA_CHECK_ERROR;
-    std::cout << "Done multiplying" << std::endl;
+//    std::cout << "Done multiplying" << std::endl;
     gradient_and_subtract_kernel <<< dimGrid, dimBlock >>> ( dev_interm, dev_grad_x, dev_grad_y, dev_grad_z);
     cudaDeviceSynchronize();
     CUDA_CHECK_ERROR;
-    std::cout << "Done computing gradient and subtracting" << std::endl;
+//    std::cout << "Done computing gradient and subtracting" << std::endl;
     magnitude_threshold_kernel <<< dimGrid, dimBlock >>> ( dev_grad_x, dev_grad_y, dev_grad_z, gamma);
     cudaDeviceSynchronize();
     CUDA_CHECK_ERROR;
-    std::cout << "Done projecting gradient onto L2 ball of radius gamma" << std::endl;
+//    std::cout << "Done projecting gradient onto L2 ball of radius gamma" << std::endl;
     }
 
   // Cleanup

  long int id_y = (k     * c_Size.y + j + 1)* c_Size.x + i;
  long int id_z = ((k+1) * c_Size.y + j)    * c_Size.x + i;

  grad_x[id] = in[id_x] - in[id];
  grad_y[id] = in[id_y] - in[id];
  grad_z[id] = in[id_z] - in[id];
}

__global__

  multiply_by_beta_kernel <<< dimGrid, dimBlock >>> ( dev_in, dev_interm, beta);
  cudaDeviceSynchronize();
  CUDA_CHECK_ERROR;
//  std::cout << "Done multiplying" << std::endl;
  gradient_kernel <<< dimGrid, dimBlock >>> ( dev_interm, dev_grad_x, dev_grad_y, dev_grad_z);
  cudaDeviceSynchronize();
  CUDA_CHECK_ERROR;
//  std::cout << "Done computing gradient" << std::endl;
  magnitude_threshold_kernel <<< dimGrid, dimBlock >>> ( dev_grad_x, dev_grad_y, dev_grad_z, gamma);
  cudaDeviceSynchronize();
  CUDA_CHECK_ERROR;
//  std::cout << "Done projecting gradient onto L2 ball of radius gamma" << std::endl;

  // Rest of the iterations
  for (int iter=0; iter<NumberOfIterations; iter++)
