The logic for sending and receiving is added