merge trees