Edited DFS and tested it in main