change graph.py to update root