almost done with model logic