exercise6.rb with groceries