 //	float4 h_origin;
 //	checkCudaErrors(cudaMemcpy(&h_origin, d_origin, sizeof(float4),cudaMemcpyDeviceToHost));
 //	std::cout << h_origin.y << std::endl;
+	cudaFree(d_origins);
+
+
+	float4 *d_normals;
+	checkCudaErrors(cudaMalloc(&d_normals, dataCount*sizeof(float4)));
+	float4 *d_normal;
+	checkCudaErrors(cudaMalloc(&d_normal, sizeof(float4)));
 
 	normal<<<dataCount/blockSize,blockSize,0>>>
 		(d_lines, d_normals, d_origin);

			cudaFree(d_beta);
			cudaFree(d_radius);
			cudaFree(d_lengths);
			cudaFree(d_origins);
			cudaFree(d_lines);

//Print some data to screen

	status = cudaStreamCreate(&windings);
	status = cudaStreamCreate(&windings2);
	status = cudaStreamCreate(&lengths);

	//Start main loop.
	for (int yindex = 0; yindex < BIGgridSize.y; yindex += gridSizeRK4.y) {
