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

//
//  Heap.swift
//  Min-heap
//
//  Created by Vyacheslav Khorkov on 18/08/2017.
//  Copyright © 2017 Vyacheslav Khorkov. All rights reserved.

	
	// Returns a minimum child of the parent and its index.
	// Complexity: O(1)
	private func minChild(parent: Int) -> (child: Element, index: Int)? {
		if let x = left(parent), let y = right(parent) {
			return x < y ?
				(child: x, index: leftIndex(parent)) :
