Use a list instead of a generator