def remove_counter_ions(name, separator=' '):
    """
remove_counter_ions
    description:
        removes unwanted counter ions (and other extras) from a compound name
    parameters:
        name (str) -- compound name
    returns:
        (str) -- compound name with counter ions removed
"""
    # counter ions to remove from compound names
    counter_ions = [
        'MALEATE', 'SULFATE', 'HEMISULFATE', 'FUMARATE', 'POTASSIUM', 'SODIUM', 'CITRATE', 'MESYLATE', 'SALICYLATE',
        'PHOSPHATE', 'CALCIUM', 'BROMIDE', 'HYDROBROMIDE', 'HYDROCHLORIDE', 'TARTRATE', 'SUCCINATE', 'HYDRATE', 
        'NITRATE', 'IODIDE', 'CHLORIDE', 'SALT', '(+/-)', '(D[+])', '[t(-)]', '(dl)'
    ]
    # check for removable counter ions
    for counter_ion in counter_ions:
        if counter_ion in name.split(separator):
            trimmed = name.split(separator)
            trimmed.remove(counter_ion)
            name = separator.join(trimmed)
    return name