working hamming distance