Modified to use coffeescript syntax