Code for chapter 2 of Meteor in Action