public static boolean disconnectSelectedAgent(int preSelectedIndex)
  {
    try
    {
      if (Drivers.alTerminals.size() < 1)
      {
        Drivers.jop_Error("There are no implants to remove at this time.                         ", "Cannot Disconnect Implant - No Implants Populated");
        return false;
      }

      int indexToRemove = 0;

      if (preSelectedIndex == -2)
      {
        indexToRemove = jtblConnectedAgents.getSelectedRowIndex();
      }
      else
      {
        indexToRemove = preSelectedIndex;
      }

      if (indexToRemove < 0)
      {
        Drivers.jop_Error("Please select an implant to remove.                        ", "Cannot Disconnect Implant - No Implant Selected");
        return false;
      }

      Thread_Terminal threadToDelete = (Thread_Terminal)Drivers.alTerminals.get(indexToRemove);

      if (Drivers.jop_Confirm("You have chosen to remove Implant: " + threadToDelete.getJListData() + "\nDo you wish to continue?", "Confirm Punting Selected Implant") != 0)
      {
        return true;
      }

      Drivers.sop("Terminating Thread ID: " + threadToDelete.getThreadID());

      if (threadToDelete.myCareOfAddressNode != null)
      {
        Drivers.jop_Message("Need to Here and input protocol to remove a Care-Of Address Node.\nPlease Notify Solomon about this Message.");
        return false;
      }

      if (threadToDelete.sktMyConnection != null)
      {
        try
        {
          threadToDelete.sktMyConnection.close();
          threadToDelete.closeThread();
        } catch (Exception localException1) {
        }
      }
      threadToDelete.continueRun = false;
      threadToDelete.killThread = true;

      return true;
    }
    catch (Exception e)
    {
      Drivers.eop("disconnectSelectedAgent.", "Splinter_GUI", e, e.getLocalizedMessage(), false);
    }

    return false;
  }