tests added to end of calc, better maximisation, freddy's shit too