Not making a generator and then trying to index it