created hamming correction and decode method