Add DFS implementation