moved javascript out of html file