done the coding for views and controller