added functions in control script
added functions in control script