Everything below this line is re-integrating old code, or changes from re-running the script.