statemachine, sort ot