Convert main.js to CoffeeScript