working on coffeescript conversion