wrote exercise2.rb