This is a cleaned up version of cash_register.rb