Code for chapter 10 of Meteor in Action