updated tests and model logic