Added functionality to receive data from peers.