added separate send and receive functions