completed to ex29.rb