added a function to the script