Update the script with new functionality