Added Jacard distance calculation