simplified the graph code w/ rootNode