completed conversion to coffee script