 	// RHS
 	b = (Real *) calloc (size, sizeof(Real));
 	
-	// temperature
-	temp = (Real *) calloc (size_temp, sizeof(Real));
-	temp_old = (Real *) calloc (size_temp, sizeof(Real));
+	// temperature arrays
+	temp_red = (Real *) calloc (size_temp, sizeof(Real));
+	temp_black = (Real *) calloc (size_temp, sizeof(Real));
 	
 	// set coefficients
 	fill_coeffs (NUM, NUM, th_cond, dx, dy, width, TN, aP, aW, aE, aS, aN, b);
 	
 	for (uint i = 0; i < size_temp; ++i) {
-		temp[i] = 0.0;
-		temp_old[i] = 0.0;
+		temp_red[i] = 0.0;
+		temp_black[i] = 0.0;
 	}
 	
 	// set device

	CUDA_SAFE_CALL (cudaMalloc ((void**) &aS_d, size * sizeof(Real)));
	CUDA_SAFE_CALL (cudaMalloc ((void**) &aN_d, size * sizeof(Real)));
	CUDA_SAFE_CALL (cudaMalloc ((void**) &b_d, size * sizeof(Real)));
	CUDA_SAFE_CALL (cudaMalloc ((void**) &temp_d, size_temp * sizeof(Real)));
	
	// copy to device memory
	CUDA_SAFE_CALL (cudaMemcpy (aP_d, aP, size * sizeof(Real), cudaMemcpyHostToDevice));

/** SOR relaxation parameter */
const Real omega = 1.85;

/** Problem size along one side; total number of cells is this squared */
#define NUM 8192

// block size
#define BLOCK_SIZE 128

/** Function to evaluate coefficient matrix and right-hand side vector.
 * 
 * \param[in]		rowmax		number of rows
 * \param[in]		colmax		number of columns
 * \param[in]		th_cond		thermal conductivity
 * \param[in]		dx				grid size in x dimension (uniform)
 * \param[in]		dy				grid size in y dimension (uniform)
 * \param[in]		width			width of plate (z dimension)
 * \param[in]		TN				temperature at top boundary
 * \param[out]	aP				array of self coefficients
 * \param[out]	aW				array of west neighbor coefficients
 * \param[out]	aE				array of east neighbor coefficients
 * \param[out]	aS				array of south neighbor coefficients
 * \param[out]	aN				array of north neighbor coefficients
 * \param[out]	b					right-hand side array
 */
void fill_coeffs (uint rowmax, uint colmax, Real th_cond, Real dx, Real dy,
				  				Real width, Real TN, Real * aP, Real * aW, Real * aE, 
				  				Real * aS, Real * aN, Real * b)
