Moved script to separate .js file, linked it to index.html.