def METHOD_NAME(elements):
    # element_order = _hill_system_sort(elements)
    element_order = _chnops_sort(elements)
    ion_formula_parts = []
    for elem in element_order:
        count = elements[elem]
        if count != 0:
            ion_formula_parts.append(elem)
            if count > 1:
                ion_formula_parts.append(str(count))
    return ''.join(ion_formula_parts)