hamming distance modified