some bugs need to be worked out on the calculator, but it works