 		double x;
 		double r;
 		double mrg = 0;
-		double pi = features[i]; // here only 1 feature!!!
-		double si = sigmas[i];
+		double mi = meas[i]; // here only 1 feature!!!
+		double ui = meas_unc[i];
 		for (int j=0; j<N_GH; j++) {
-			x = pi + c_rt2 * si * c_absc[j];
+			x = mi + c_rt2 * ui * c_absc[j];
 			r = rho(x, mu, var);
 			mrg += c_wts[j] * r;
 		}

			std::cerr << "ERROR: Block is too large" << std::endl;
			return 2;
		}
		marginals<<<nBlocks,nThreads>>>(p_theta, dim_theta, n_theta, p_features, p_sigmas, m, n, p_marg);

		// do anything here on the CPU?



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