Minor change in the P2P function