Convert javascript to coffeescript