Changed to stack-based graph.