public static int posMax1(CharSeq s)
  {
    char MaxVal = 0; //initialize as 0 (no problem since these aren't ints)
    int MaxValPos = -1; //initialize maximum position as error
    CharSeqIt csi = new CharSeqIt(s); //initialize iterator
    char next; //char for holding the next value
    int i = 0;

    if(!csi.hasNext()) //if we're at the end   
      return MaxValPos; //return -1, empty sequence

    try
    {    //any call to next() is enclosed in a try-catch block
      while(csi.hasNext())//while there is something next
      {
        next = csi.next(); //put the next character into char next
        if(MaxVal < next) //if that's greater than what's currently in MaxVal
        {
          MaxVal = next; //set the maximum value to next
          MaxValPos = i; //set the position of the maximum value
        } //end if
        i++; //increment i every time to keep track of current position
      }//end while
    } catch(UsingIteratorPastEndException e){}

    return MaxValPos;
  }//endposMax1()