wrote the model in coffeescript