 	cudaArray* dataArray;
 	cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc(32,32,32,32,cudaChannelFormatKindFloat);
 	cudaMallocArray(&dataArray, &channelDesc,N,N,N);
-	cudaMemcpyToArray(dataArray,0,0,hostpointer,cudaMemcpyHostToDevice);
+	cudaMemcpyToArray(dataArray,0,0,hostpointer,N*N*N*sizeof(float4), cudaMemcpyHostToDevice);
 	cudaBindTextureToArray(dataTex, dataArray, channeldesc);
-	nullkernel<<<1,1>>>();
+	float4 *lines;
+	int steps = 20;
+	int cores = 1;
+	int blocks = 1;
+	float dt = 1/8.0;
+	float4 startloc = {{0}};
+	cudaMalloc(&lines,blocks*cores*steps*sizeof(float4));
+	RK4line<<<cores,blocks>>>(lines, dt, steps, startloc);
 	printf("Hello World!\n");
 	return 0;
 }

	return make_float3(a*b.x, a*b.y, a*b.z);
}

__device__ float4 RK4step(double3* output, double3 loc, double dt ) {
	float4 k1 = tex3D(dataTex, (float3)loc); // of moet ik hier loc.x,loc.y,loc.z meegeven?
	float4 k2 = tex3D(dataTex, (float3)loc+dt*0.5*k1);
	float4 k3 = tex3D(dataTex, (float3)loc+dt*0.5*k2);
	float4 k4 = tex3D(dataTex, (float3)loc+dt*k3);
	return dt/6.0*(k1 + 2.0*((double4)k2 + (double4)k3) + k4);
}



texture <float4, cudaTextureType3D> dataTex;

int N = 256;
//Definitions of vectortype operators
__device__ float3 operator+(const float3 &a, const float3 &b) {
	return make_float3(a.x+b.x, a.y+b.y, a.z+b.z);
}
