Reworked calculator to remove duplicate user input tests.