Introduced state machine for tutorials