Almost working correctly, need to fix bug in multimerge