Added a two-dimensional hamming distance, based on something that I just worked out.