Added deepCopy() function and am now calling from set().