Adding utility code for xmodem