Rewritten DSGMCoreClass.js