more work on stateautomata