the example used in Ruby in Action!