Added gibbs and variational versions