Understanding the merge logic