change to new data structure of nodes and network