add comments and documentation