Initial version of the control script written in JavaScript