 
         while unbalancedIndex > 0 {
             let parentIndex = (unbalancedIndex - 1) / 2
-
-            if _hasHigherPriority(_elements[unbalancedIndex], _elements[parentIndex]) {
-                swap(&_elements[unbalancedIndex], &_elements[parentIndex])
-
-                unbalancedIndex = parentIndex
-            }
-            else {
-                break
-            }
+            guard _hasHigherPriority(_elements[unbalancedIndex], _elements[parentIndex]) else { break }
+            
+            swap(&_elements[unbalancedIndex], &_elements[parentIndex])
+            unbalancedIndex = parentIndex
         }
     }
 

                highestPriorityIndex = rightChildIndex
            }

            if highestPriorityIndex != unbalancedIndex {
                swap(&_elements[highestPriorityIndex], &_elements[unbalancedIndex])

                unbalancedIndex = highestPriorityIndex
            }
            else {
                break
            }
        } while true
    }
}


        precondition(initialUnbalancedIndex < _elements.count)

        var unbalancedIndex = initialUnbalancedIndex
        while true {
            let leftChildIndex = unbalancedIndex * 2 + 1
            let rightChildIndex = unbalancedIndex * 2 + 2

