almost sorted array