Updated main.js new functions