create functions in script