 		return nil
 	}
 	
-	// Swaps two values by their indexes.
+	// Swaps two elements by their indexes.
 	// Complexity: O(1)
 	private mutating func swap(_ i: Int, _ j: Int) {
 		Swift.swap(&a[i], &a[j])
 	}
 	
-	// Returns the parent value of child.
+	// Returns the parent element of child.
 	// Complexity: O(1)
-	private func parent(_ child: Int) -> T? {
+	private func parent(_ child: Int) -> Element? {
 		let i = parentIndex(child)
 		guard i >= 0 && i < a.count else { return nil }
 		return a[i]
 	}
 	
-	// Returns the left child value of parent.
+	// Returns the left child element of parent.
 	// Complexity: O(1)
-	private func left(_ parent: Int) -> T? {
+	private func left(_ parent: Int) -> Element? {
 		let i = leftIndex(parent)
 		guard i < a.count else { return nil }
 		return a[i]
 	}
 	
-	// Returns the right child value of parent.
+	// Returns the right child element of parent.
 	// Complexity: O(1)
-	private func right(_ parent: Int) -> T? {
+	private func right(_ parent: Int) -> Element? {
 		let i = rightIndex(parent)
 		guard i < a.count else { return nil }
 		return a[i]

		return root
	}
	
	// Inserts a new value to heap and supports heap property.
	// Complexity: O(log n)
	public mutating func insert(_ value: T) {
		a.append(value)
		siftUp()
	}
	
	// Build heap with array.
	// Complexity: O(n)
	private mutating func build(_ a: [T]) {
		self.a = a
		for i in stride(from: a.count / 2 - 1, through: 0, by: -1) {
			siftDown(i)

		return parent * 2 + 2
	}
	
	// The array of heap elements.
	private var a = [Element]()
	
	// Returns debug description.
	// Useful for tests.
	public var debugDescription: String {
		return a.description
	}
}
