Turned the JavaScript into CoffeeScript