working implementations for transmit and receive