Adding hamming_distance.