findNextNode method created, now traversing grammars
transient states can have lengths and end words