added generator to yield nodes