move demo script to demo.js