more complicated merge