refactored gibbs sampler and finished first pass on sampling algorithm