Updated merge functionality