functions need for various scripts