added merge node functionality