final version of calculator.rb