Update main.js

Replaced #3 which was overwritten by #4