Move the javascript into main.js