implementing DFAState part 1