This is a part of a commit to add in ai.
Currently trying to get rid of deepcopy because it's slow