move javascript out of html to file for good coding practices