finish translating from coffeescript