Finish creating the calculator function