public static <T extends Comparable<T>>  T findMin(List<T> al){

        T min=null;
        //remember to test if null or empty-throw an exception-index out of bounds used here
        if((al==null)||(al.isEmpty())){
            throw new IndexOutOfBoundsException("Empty or non-existent list");
        }
        else{
            //start with first element on the list
            min=al.get(0);
            for(T item: al){
                //cannot use this unless extending comparable
                if(item.compareTo(min)<0){
                    min=item;
                }
            }
        }

        return min;
    }