Added doxygen config
Removed dynamic_cast() and added comments