convert javascript to coffeescript'