Implemented the send function