Setting the control functions