Update main.js

stupid repetitious code