js converted to coffeescript