Added some comments; Using lengthSquared to avoid square roots