created function from script file