adds the possibility of recursive merging