Removed unnecessary sorting.