implemented headings + code cleanup