converted away from coffeescript