Move mag calculation after sqrt calculation