trying to remove latches from state machine