Update code documentation and formatting of comments