mem handling and some doxygen docs