sort works with unsorted data