public void addSorted(PriorityPair pNew){
			ListElement el = head;
			if(el == null){
				addFirst(pNew);
				return;
			}
			else if (pNew.compareTo((PriorityPair)head.first())>0) {
				addFirst(pNew);
			}
			else {
				while(el.rest()!=null && pNew.compareTo((PriorityPair)el.rest().first())<=0){
					el = el.rest();
				}
				el.setRest(new ListElement(pNew, el.rest()));
				size++;
			}
		}