exploding function in main.js