Added ProcessSubgoals dont think its correct with the datastructure Stack