Finally compiles, fixed off by one bug, need normal calc now