added merge functionality