finished peer_init and other prototypes