changed prototype for get_peer_list and added free function