use the DFS to do