Transfered over code to index.html and main.js