Added code for view and model