create network.cpp to implement funtions defined in headfile