Translate through lines 469 into CoffeeScript