updated chapter 5, chapter5.rb,  with notes on section 5.7