Tranfers script from index.html to scrtipt-main.js