initial fsm states
merged
submachine nearly working