example from learn ruby the hard way.