It now works for n-dimensional pts , changed the eucelidean_distance function to handle n dimensions instead of  the 3 dimensions earlier