public void insert(T x) {
		if (size == heapArray.length - 1) {
			doubleSize();
		}
		int pos = ++size;

		for (; pos > 1 && x.compareTo(heapArray[pos / 2]) < 0; pos = pos / 2) {
			heapArray[pos] = heapArray[pos / 2];
		}

		System.out.println("inserted " + x + " at " + pos);
		heapArray[pos] = x;
	}