part a done, model and gui working together