Updated graph.py; fixed pre-fix, depth-first traversal