Beginning of the controller