<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_sections(app, doctree, fromdocname):
 """Add section titles to the needs as additional attributes that can be used in tables and filters"""

    needs = getattr(app.builder.env, 'needs_all_needs', {})
    for key, need_info in needs.items():
        sections = get_sections(need_info)
        need_info['sections'] = sections
        need_info['section_name'] = sections[0] if sections else ""