start DFS first, then format