Cleaned up the TOC nav function