updating P2P code