Updated code to save mcmc chains after running