Added sending and receiving functionality.