implemented DFS and dump