cleaned up control script