Moved the Javascript out of the html file and into its own .js file