Simplified merge subroutine