 				scaled_proposal_j += cholfact[cholfact_index] * snorm_deviate[k];
 				cholfact_index++;
 			}
-			proposed_chi[j] = chi[j] + scaled_proposal_j;
+			proposed_chi[j] = chi[c_ndata * j + idata] + scaled_proposal_j;
 			scaled_proposal[j] = scaled_proposal_j;
 		}
 		return proposed_chi;

	virtual void UpdateKernel(double* meas, double* meas_unc, double* chi, double* theta, double* cholfact,
			double* logdens_meas, double* logdens_pop, curandState* devStates, int current_iter, int* naccept)
	{


	}


        CholUpdateR1(p_cholfact, p_scaled_proposal, dim_theta, downdate);
	}

	// calculate whether to accept or reject the metropolist-hastings proposal
	bool AcceptProp(double logdens_prop, double logdens_current, double& ratio, double forward_dens = 0.0, double backward_dens = 0.0)
	{
        double lograt = logdens_prop - forward_dens - (logdens_current - backward_dens);
        lograt = std::min(lograt, 0.0);
