made a sorting list instead of heap