Moved everything from overlay.js to main.js