Added the demo generation logic