Adding in more complex subgoal processing