 	//////////////////////////////
 	
 	// allocate device memory
-	Real *aP_d, *aW_d, *aE_d, *aS_d, *aN_d, *b_d, *temp_d;
+	Real *aP_d, *aW_d, *aE_d, *aS_d, *aN_d, *b_d;
+	Real *temp_red_d, *temp_black_d;
 	
 	CUDA_SAFE_CALL (cudaMalloc ((void**) &aP_d, size * sizeof(Real)));
 	CUDA_SAFE_CALL (cudaMalloc ((void**) &aW_d, size * sizeof(Real)));

	printf("GPU\nIterations: %i\n", iter);
	printf("Time: %f\n", (end_time - start_time) / (double)CLOCKS_PER_SEC);
	
	FILE * pfile;
	pfile = fopen("temp_gpu.dat", "w");
	
	if (pfile != NULL) {
		fprintf(pfile, "#x\ty\ttemp(K)\n");
		
		for (uint row = 1; row < num_rows - 1; ++row) {
			for (uint col = 1; col < num_cols - 1; ++col) {
				uint ind = col * num_rows + row;
				Real x_pos = (col - 1) * dx + (dx / 2);
				Real y_pos = (row - 1) * dy + (dy / 2);
				fprintf(pfile, "%f\t%f\t%f\n", x_pos, y_pos, temp[ind]);
			}
			fprintf(pfile, "\n");
		}

	free(aS);
	free(aN);
	free(b);
	free(temp_red);
	free(temp_black);
	
	free(bl_norm_L2);
	
