Improved run-time performance of calculator.