Added implementation of gibbs sampler algorithm