     temperature = exp(chi[2]);
     
     double logdensity = 0.0
-    for (int k=0; k<m; k++) {
+    for (int k=0; k<c_m; k++) {
         model_sed = modified_bbody(c_nu[k], normalization, beta, temperature);
         double stnd_meas = (meas[k] - model_sed) / meas_unc[k]
         logdensity += -0.5 * stnd_meas * stnd_meas;


// Function to compute the conditional log-density of the measurements given the chi value
__device__
double logdensity_meas(double* meas, double* meas_unc, int m, double* chi) {

    double normalization, beta, temperature;
    normalization = exp(chi[0]);

        }

        // Compute the conditional log-posterior of the proposed parameter values for this data point
        double meas_i[c_m]
        double meas_unc_i[c_m]
        for (int k=0; k<c_m; k++) {
            // grab the measurements for this data point
            meas_i[k] = meas[n * k + i];
            meas_unc_i[k] = meas_unc[n * k + i];
        }
        
        logdens_meas = logdensity_meas(meas_i, meas_unc_i, new_chi);
        logdens_pop = logdensity_pop(new_chi, c_theta);
        double logdens_prop = logdens_meas + logdens_pop;
        
        // Compute the Metropolis ratio
