Modified calculator.php to be object oriented