Ported to CoffeeScript