main js code in main.js