update code to use coffee script