dfa minimization rewritten more clearly