setting up the controller