switched from straight state machine to a goal-vs-action distinction