JS code seperated to main.js file