working on sortedlist