finished calc (with bugs, probably depending on the ggt bad arith bug