Updated to preform the sqrt on Euclid distance.