Exercise 17.rb half-way complete