Add demo for generator function