Add and configure the state machine

Last updated