modify gennetwork2.cpp