updated problem1.rb