 
 		__syncthreads();
 
+
 	}
 	//Now there is only global fill to handle.
 
 	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 - 15] = temper[tid+1];
-
-	}
-
-
-
+		IC[gid - 16] = temper[tid+1];
+	}
+	else
+	{
+		if (tid>15)
+		{
+			IC[gid - 16] = temper[tid+2];
+		}
+		else
+		{
+			IC[(blockDim.x * gridDim.x) + (tid - 16) ] = temper[tid+2];
+		}
+	}
 
 }
 
 
 int main()
 {
+
+	cudaSetDevice(0);
 	const int dv = int(DIVISIONS);
 	const int bks = dv/32;
 	const REAL ds = LENX/(DIVISIONS-1);
 	REAL fou = TS*TH_DIFF/(ds*ds);
 
 	REAL IC[dv];
+	REAL T_final[dv];
 	REAL *d_IC, *d_right, *d_left;
 
 	for (int k = 0; k<dv; k++)

	cudaMemcpy(d_IC,IC,sizeof(REAL)*dv,cudaMemcpyHostToDevice);

	// Some for loop

	upTriangle <<< bks,32 >>>(d_IC,d_right,d_left);


	downTriangle <<< bks,32 >>>(d_IC,d_right,d_left);

	// Some condition about when to stop or copy memory.



	// End loop and write out data.



	cudaFree(d_IC);
	cudaFree(d_IC2);
	cudaFree(d_coll);

	return 0;

}

			{
				temper[tid + (34*shft_wr)] = fo * (temper[tid+shft_rd-1] + temper[tid+shft_rd+1]) + (1-2.*fo) * temper[tid+shft_rd];
			}

		}
		//Split part
