DFS working properly