Basic structure for hamming distance