made changes allocating needed memory only
doxygen fixes
doxygen fix