added comments and fixed doxygen