converted to CoffeeScript