generator functions: can now have three yield statements: head, body, tail