changed Euclidean distance metric to squared Euclidean distance