Re-wrote the script.