added a euclidian distance option