added functions to model, tests not working