added tests, changed some models and views