Changing  structure and adding some semi colons in main.js to make jshint happy