Fixing some maths