Moved code to index.html