Added copy() function