setting up function view of the controller