Added functions to script