 	// 3 color channels to keep results for
 	// TODO : reduce n down to 1 per block since it is the same
 	//        for all 3 channels
-	cudaMalloc(&d_M1, 3*numBlocks * sizeof(float));
-	cudaMalloc(&d_M2, 3*numBlocks * sizeof(float));
-	cudaMalloc(&d_n,  3*numBlocks * sizeof(unsigned int));
+	cudaMalloc(&d_M1, 3 * numBlocks * sizeof(float));
+	cudaMalloc(&d_M2, 3 * numBlocks * sizeof(float));
+	cudaMalloc(&d_n,  3 * numBlocks * sizeof(unsigned int));
 
 	// Create a CPU stream. This lets us queue up a number of
 	// cuda calls back to back and then later check to see

		// add xIndex to get to the correct location in this row
		// Multiply by three to account for R, G, B float values
		//   per col in the input images
		const int flatIdxX = 3*(yIndex * input[zIndex].cols + xIndex);
		output(zIndex, flatIdxX + 0) = blue;
		output(zIndex, flatIdxX + 1) = green;
		output(zIndex, flatIdxX + 2) = red;

	const int zIndex = blockIdx.z * blockDim.z + threadIdx.z;

	//Only valid threads perform memory I/O
	if((xIndex < cols) && (yIndex < rows))
	{
		// yIndex * cols = number of floats per complete
		// filled row
