lots of comments and documentation