implemented headings properly, polished some stuff and prepared for future node types