changed to euclidian distance