separate function for discrete mcmc