changed the structure of the control scripts