public void updateModes(String modes) {
    IRCModeParser parser = new IRCModeParser(modes);
    modes = ""; // reset modes, we will order them
    String args = "";
    char operator;
    char mode;
    for (int i = 1; i <= parser.getCount(); i++) {
      operator = parser.getOperatorAt(i);
      mode = parser.getModeAt(i);
      modes += String.valueOf(operator) + String.valueOf(mode);
      if (mode == 'k' || mode == 'l') // limit and key have arguments
        args += " "+ parser.getArgAt(i);
    }
    modes += args;
    modebuffer = new StringBuffer(modes);
  }