add tree clone functionality.