DFS and state updates