Checked that IsSorted function does not copy the data.