         }
 
         // Compute the conditional log-posterior of the proposed parameter values for this data point
-        double meas_i[m];
-        double meas_unc_i[m];
+        double meas_i[mfeat];
+        double meas_unc_i[mfeat];
         for (int k=0; k<c_m; k++) {
             // grab the measurements for this data point
             meas_i[k] = meas[n * k + i];

    thrust::device_vector<double> d_meas_unc = h_meas_unc;
    thrust::device_vector<double> d_chi = h_chi;
    thrust::device_vector<double> d_prop_cholfact = h_prop_cholfact;
    thrust::device_vector<double> d_logdens(n);  // log posteriors for an individual data point

    thrust::fill(d_logdens.begin(), d_logdens.end(), -1.0e300);



    // Cuda grid launch
    dim3 nThreads(256);
    dim3 nBlocks((ndata + nThreads.x-1) / nThreads.x);
    printf("nBlocks: %d\n", nBlocks.x);  // no more than 64k blocks!
    if (nBlocks.x > 65535)
    {
