moving JS to its own file