iterative DFS successfully done