merge_ere now with check sort