Refactored step-dfa; got it to work