code: public boolean addSorted(E element, boolean allowDuplicates) {
  		boolean added = false;
  		if(!allowDuplicates){
  			if(this.contains(element)){
  				System.err.println("item is a duplicate");
  				return added;
  			}}
  		added = super.add(element);
  		Comparable<E> cmp = (Comparable<E>) element;
  		for (int i = size() - 1; i > 0 && cmp.compareTo(get(i - 1)) < 0; i--)
  			Collections.swap(this, i, i - 1);
  		return added;
  	}
docs: adds an element to the list in its place based on natural order.
  
  @param element
  element to be appended to this list
  @param allowDuplicates if true will allow multiple of the same item to be added, else returns false.
  @return true if this collection changed as a result of the call