initial design of state machine