Converted to Coffeescript
Restructured