added some documentation to functions
issue with some anchors not forming correctly now solved without creating a ridiculous number of references