Cleaned up mainScript.js