merging procedure formulated as a separate task