generating jaccard matrix