changing distanceSquared to distance

much more performance heavy, will try and optimize more in the near future.