private ListNode insertIntoSortedList(ListNode target, ListNode source){
    	//initialize
    	if(target == null){
    		target = new ListNode(source.val);
    	}else{
    		ListNode p = target;
    		
    		//if source is the smallest one.
    		if (target.val > source.val) {
				target = new ListNode(source.val);
				target.next = p;
			}else{
	    		while(p != null){
	    			ListNode pNext = p.next;
	    			
	    			//the last node in the list
	    			if(pNext == null){
	    				if(p.val < source.val){
	    					p.next = new ListNode(source.val);
	    				}else{
	    					ListNode element = new ListNode(p.val);
	    					p.val = source.val;
	    					p.next = element;
	    				}
	    			}else if(p.val <= source.val && source.val < pNext.val){
	    				ListNode element = new ListNode(source.val);
	    				p.next = element;
	    				element.next = pNext;
	    				break;
	    			}
	    			
	    			p = pNext;
	    		}
			}
    	}
    	
    	return target;
    }