And it seems this should be #next_states and return an empty array and possibly memoize. Seems you will need to iterate possibly more than one since some may have an error state option.