add comments and generate docs