Added tests and model changes