fixed the maths