fix a bug; start working on gibbs.