add DFS algorithm