finished generator example