Updated ex9.rb