 	if (err != CUDA_SUCCESS) { return 1; }
 
 	// Allocate data on CPU and load 
-	thrust::host_vector<double> h_features(n*m);
-	thrust::host_vector<double> h_sigmas(n*m);
+	thrust::host_vector<double> h_meas(n*m);
+	thrust::host_vector<double> h_meas_unc(n*m);
 
 	unsigned int seed = 98724732;
 	double sigma_msmt = 3.;


// Kernel to derive the log marginals for each data item and parameters
__global__
void marginals(double *theta, int dim_theta, int n_theta, double *features, double *sigmas, int m, int n, double *marg)
{
	int i = blockDim.x * blockIdx.x + threadIdx.x;
	int i_theta = blockDim.y * blockIdx.y + threadIdx.y;

		// log marginal likelhoods in parallel on all threads independently
		double* p_marg = thrust::raw_pointer_cast(&d_marg[0]);
		double* p_theta = thrust::raw_pointer_cast(&d_theta[0]);
		double* p_meas = thrust::raw_pointer_cast(&d_meas[0]);
		double* p_meas_unc = thrust::raw_pointer_cast(&d_meas_unc[0]);

		// cuda grid launch
		dim3 nThreads(512,1);
