Moved main code from index.html to js/main.js