Ported to coffeescript