recover sorted array