modified newMain.js

cleaned up old code.