finished alternative method for hamming_distance