moved the network initialization function to the main section