move script form head of index to script.js