added function clone to enable deep copy