v2 handles recursive subgoal problem