Change some function of ED: still 40 sec

So that the Jaccard func can re-use it