Jaccard distances calculation

Side-effects eliminated by lines 76:78