moving demo code from main.js to index.html