Code for chapter 12 of Meteor in Action