full code of MCMC sampling
cleanup