Code written while reading the Discover Meteor book from http://www.discovermeteor.com/