Updated ex6.rb