modified demo.js