Added rewrite of Gibbs sampler