hamming first iteration