private void bubbleDown() {
        int parent = 0;        // Parent position
        int left;              // Left child
        int right;             // Right child

        int maxPos;            // Position of the largest child
        int maxValue;           // Value of the largest child

        boolean continueScan;  // When true heap is ordered

        // Only need to look if the heap this.size is greater than 1
        if (this.size > 1) {
            do {
                left = parent * 2 + 1;
                right = parent * 2 + 2;

                continueScan = false;

                if (left < this.size) {
                    // I have at least one child

                    if (right < this.size) {
                        // I have two children - figure out which is
                        // the larger
                        if (this.heap[left] > this.heap[right]) {
                            // Left is the bigger
                            maxValue = this.heap[left];
                            maxPos = left;
                        }
                        else {
                            // Right is the largest
                            maxValue = this.heap[right]; 
                            maxPos = right;
                        }

                        // If the parent is smaller than the largest child
                        // swap them and continue scan
                        if (this.heap[parent] < maxValue ) {
                            int temp = this.heap[parent];
                            this.heap[parent] = this.heap[maxPos];
                            this.heap[maxPos] = temp;
                            parent = maxPos;
                            continueScan = true;
                        }
                    }
                    else {
                        // Only one child (must be the larger) - is the
                        // parent smaller than the left child?
                        if (this.heap[parent] < (this.heap[left])) {
                            // Yes - swap them
                            int temp = this.heap[parent];
                            this.heap[parent] = this.heap[left];
                            this.heap[left] = temp;
                            parent = left;
                            continueScan = true;
                        }
                    }
                }
            } while (continueScan);
        }


    }