removed unnecessary sorting