made recursive DFS destroy