Trying another approach to generators