updating the code and finishing the doxygen documentation