moved the scripts from index.html to main.js