Working integration between gui and model