added ex4.rb