Update main.js

Simplified