added code to ex1.rb