def dehidratate(traj, other=("Na+", "Cl-")):
    """
    Method that removes the waters and ions from the trajectorie.
    PARAMS:
    traj: mdtraj trajectory with topology
    other: tuple with additional atom names to remove
    system_indexes: list with the indexes of the system, this is to save time, if provided,
    the function will not calculate them again.
    RETURNS:
    mdtraj trajectory without waters and the indexes of the system.
    """
    system_indexes = []
    if not system_indexes:
        for residue in traj.topology.residues:
            if residue.name not in ("HOH", "WAT") and residue.name not in other:
                for atom in residue.atoms:
                    system_indexes.append(atom.index)
    traj = traj.atom_slice(system_indexes)
    return traj