implemented fitModel

Instead of the view owning everything, now the models does instead.