Note that you can use python -m cProfile main.py to do profiling.
removed some unneeded deepcopy calls and some old code that wasn't being used anymore.
Found a few cases in which deepcopy was not required, which saves a little time.
Found even more deepcopy calls that do not appear to be required.