getting ordered statemachine to work