implements cloneDeep