Update headings logic

- Completed `_updateHeadings()` function