change mergeTrees arguments to Array