implement passandreceive