Edited code to be between the model, view and controller objects.