Adding Hamming encoder to transmit function