public void maxHeapify(int[] array, int i, int heapSize) {
		int left = leftChild(i);
		int right = rightChild(i);
		int largest;

		//left less than length of array minus 1
		//compare current node and two child nodes
		if (left < heapSize && array[left] > array[i]) {
			largest = left;
		} else {
			largest = i;
		}

		if (right < heapSize && array[right] > array[largest]) {
			largest = right;
		}

		if (largest != i) {
			swap(array, i, largest);

			maxHeapify(array, largest, heapSize);
		}

	}