initial model code and tests