moved script from html body to main.js