rebased hamming alternative