private boolean isHeap(){
		for (int i = 0; i<theHeap.size(); i++){
			E toCompare = theHeap.get(i);
			if ( (hasLeftChild(i) && theHeap.get(leftChild(i))!=null &&
				toCompare.compareTo(theHeap.get(leftChild(i)))*(isMax ? 1:-1)<0)
					||  (hasRightChild(i) && theHeap.get(rightChild(i))!=null &&
					toCompare.compareTo(theHeap.get(rightChild(i)))*(isMax ? 1:-1)<0))
				return false;
		}
		return true;
	}