copy function

Duplicate object.