Implementation of Goldwater&al