private void siftDown(int pos) {
        assert ((pos >= 0) && (pos < size)): "Illegal heap position";
        while (!isLeaf(pos)) {
            //Retrieve the left Child
            int child = leftChild(pos);
            //Instead of using compareTo(), we compare the left and right child
            //and select the larger of the two
            if ((child < (size - 1))
                && (rH.getKey(child) < rH.getKey(child + 1))) {
                child++;// child is now index of child with greater value
            }
            //Compare the child to it's parent
            if (rH.getKey(pos) >= rH.getKey(child)) {
                return;
            }
            rH.swap(pos, child);
            pos = child;
        }
    }