changed to memcpy for transferring messages from sendrecieve to the main program