move js out of html and into a seperate js file