changes for encoding to FSK and put into transmitFunction