add DFS implementation