Defining the controller