Added DFS and topological sort