Version with docs and improved Hamming distance.