First go at the model code.