adding node merging using yoav's partition