Before rewriting DFS