update the method to calculate distance between data points