Modified calc.hs