first version of the SM
State machine