public void insertAscend (int x) {
    	
    	if (isEmpty()) {
    		insert(x);
    		median = head.post;
    		balance = 0;
    	}
    	else {
    		if (x >= median.data) balance ++;
    		else balance--;
    		System.out.println("BALANCE=" +Integer.toString(balance));
    		if (balance == 2 || balance == -2) {
    			updateMedian();
    		}
    		
    		DLLNode temp = head.post;
    		while (x >= temp.data) {
    			if (temp != tail) {
    				temp = temp.post;
    			}
    			else {
    				insertPost (temp, x);
    				return;
    			}
    		}
    		//seems that temp has not reached the tail, and got stuck!
    		temp = temp.pre;
    		insertPost(temp, x);
    		return;
    	}
    }