Added basic FSM functionality