moving js to main html file to get demo to work