added functions to calculator.rb