redone: nfa: use breadth-first traversal rather than recursion