Update headings logic

- Completed `_updateHeadings()` function
Merge pull request #43 from stulees/chore/update-headings

Update headings logic