Code for chapter 06 of Meteor in Action