Made the agent a state machine, more intuitive for inheritance