added clone function.