port to coffee; fixes #3, fixes #4