ok for pure dfs bfs