Full planning integration into master

Knowledgebase phase of project is complete!
This for loop iterates through all subgoals and attempts to plan them, but you only keep track of the last one. Is this correct?