adding a lot of comments and doxygen