Changed the comprehension to a generator