Building the control script