removed js from html to .js file and formatted it