Working on the PrepareMerge subroutine.