Converted to Coffeescript