Implementation of jaccard similarity