 			itr+=2;
 
 		}
-
 		__syncthreads();
 
-
-	}
-	//Now there is only global fill to handle.
-
+	}
+
+	//Now fill the global unified timestep variable with the final calculated
+	//temperatures.
+
+	//Blocks 1 to end hold values 16 to end-16.
 	if (blockIdx.x > 0)
 	{
 		//True if it ends on the first row! The first and last of temper on the final row are empty.
 		IC[gid - 16] = temper[tid+1];
 	}
+	//Block 0 holds values 0 to 15 and end-15 to end.  In that order.
 	else
 	{
 		if (tid>15)

#define REAL       float
#define TH_DIFF    8.418e-5

__constant__ REAL fo;

__global__ void upTriangle(REAL *IC, REAL *right, REAL *left)
{

	__shared__ REAL temper[64];
	__shared__ REAL sR[32];
	__shared__ REAL sL[32];

	int gid = blockDim.x * blockIdx.x + threadIdx.x; //Global Thread ID
	int tid = threadIdx.x;
	int shft_wr;
	int shft_rd;

	temper[tid] = IC[gid];
	__syncthreads();
	int itr = -1;

	for (int k = 1; k<16; k++)
	{
		shft_wr = (k & 1);
		shft_rd = 32*((shft_wr+1) & 1);

		if (tid <= (31-k) && tid >= k)
		{
			temper[tid + (32*shft_wr)] = fo * (temper[tid+shft_rd-1] + temper[tid+shft_rd+1]) + (1-2.*fo) * temper[tid+shft_rd];
		}

		__syncthreads();

		if (shft_wr)
		{
			sL[k+itr] = temper[k-1];
			sL[k+itr+1] = temper[k];


	}

	//After the triangle has been computed, the right and left shared arrays are
	//stored in global memory by the global thread ID since (conveniently),
	//they're the same size as a warp!
	right[gid] = sR[tid];
	left[gid] = sL[tid];

}

//The upside down triangle.  This function essentially takes right and left and
//returns IC.

//IMPORTANT note: k and tid were in sync in the first function, but here they're
//out of sync in the loop.  This is because we can't use tid = 33 or 32 and the
//shared temperature array is that long.  BUT in order to fill the arrays, these
//elements must be accessed.  So each element in each row is shifted by +1.
//For instance, thread tid = 16 refers to temper[17].  That being said, tid is
//unique and k is NOT so the index must be referenced by tid.

__global__ void downTriangle(REAL *IC, REAL *right, REAL *left)
{
