Sorted the list of nodes in a queue by position