added model and changed controller