Added Generator function definition