tweaked state machine initialization