moved js to a file