Added missing "from copy import deepcopy" statement