adding measures for distance between patterns