moved expand (only remaining JS in demo.html) to JS file (functions.js)