public static int posMax2(CharSeq s)
  {
    CharSeqIt csi = new CharSeqIt(s); //initialize iterator
    char next; //char for holding the next value
    char MaxVal = 0; //initialize at 0
    int MaxValPos = -1; //initialize position of max value at error value
    int i = 0; //for keeping track of current position

    try
    { //next() in try-catch
      while(true) 
      {
         next = csi.next(); //next = next value in sequence    
         if(MaxVal < next) //if that's bigger than the current MaxVal
         { 
           MaxVal = next; //replace MaxVal
           MaxValPos = i; //up the position counter to the current place
         }//end if
         i++; //increment position every time
      }//end while
    }catch(UsingIteratorPastEndException e) {} //catches when we hit the end of the sequence
  
    return MaxValPos;
 }//endposMax2