Generating Function Method