adds logic for determining header levels

This works, but the regex is temporary