translated to coffeescript