Gibbs sampling implemented