Converted js to coffeescript