some cleaning. Added doxygen comments