adding necessary functions for a peer.