 
 	cudaFree(devCurrVal);
 	cudaFree(devPrevVal);
-	cudaFree(devNextVal);
 
 	free(currVal);
 

	initLine<<<numOfBlocks, threadsPerBlock>>>(devPrevVal, devCurrVal, totalPoints);

	printf("Updating all points for all time steps...\n");
	updateAll<<<numOfBlocks, threadsPerBlock>>>(devPrevVal, devCurrVal, devNextVal, totalPoints, totalSteps);

	printf("Printing final results...\n");
	HANDLE_ERROR(cudaMemcpy(currVal, devCurrVal, allocPoints * sizeof(float), cudaMemcpyDeviceToHost));


void checkParam();
__global__ void initLine(float*, float*, int);
__global__ void updateAll(float*, float*, int, int);
void printResult();

int totalSteps, totalPoints, allocPoints;
float *currVal;
float *devCurrVal, *devPrevVal;

int main(int argc, char *argv[]) {
	sscanf(argv[1], "%d", &totalPoints);
