Update main.js

1 function only, shorter.