Fixed more maths, thanks to Sangar