Cleaned up mainG.js, and included notes