use a generator