added MCMC weight function