 	{
 		shRight[tid] = left[tid];
         __syncthreads();
-        if (tid1 == blockDim.x) shRight[tid] = shRight[tid-1];
+        if (tid1 == blockDim.x) shRight[tid] = shRight[tid-2];
 	}
 	else
 	{
 		shRight[tid] = left[gid+blockDim.x];
-        if (gid == 0) shLeft[tid-1] = shLeft[tid];
+        if (gid == 0) shLeft[tid] = shLeft[tid2];
 	}
 
 	if (tid < 2)


	extern __shared__ REAL share[];

	REAL *temper = (REAL*) share;
	REAL *shRight = (REAL*) &share[2*blockDim.x+4];
	REAL *shLeft = (REAL*) &share[3*blockDim.x+4];

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


//-----------For testing --------------

__host__ __device__ void initFun(int xnode, REAL ds, REAL lx,REAL result)
{

    result = 500.f*expf((-ds*(REAL)xnode)/lx);

}

__host__ __device__ REAL execFunc(REAL tLeft, REAL tRight, REAL tCenter)
{

    return fo*(tLeft+tRight) + (1.f-2.f*fo)*tCenter;
