Exercise/practice from http://ruby.bastardsbook.com/toc/