added distanceSquared