Updated 1 to a generator function