ENH now used  instead of euclidean distance to gain speed