added the send and receive function bodies