Translated to coffeescript