changing formula to use Euclidian distance
formula comment was reversed