Add full commenting functionality as well as minor core code change