gibbs_sampling
corrected a few errors