updated goal-driven behaviour

- finalised new structure of goal-driven behaviour.
- debugged + some small optimisation