added ex6.rb