moved scripts to better location in html