Adding the calculator logic