reformatted demo.js