more efficient merge