a bit of cleanup, inv square math a bit messsed up