Add Gibbs method and Fix #1