Uses squared distance instead of distance

Optimization: Math.sqrt() is expensive to calculate.
Turns out it's unneeded.