generating functions part 1