Changed GoalStack implementation