move control to run javascript for worm animation to the js file, instead of the html