algorithm - before merge with merge-all