Adding instance variable version of calculator.rb