Added tests and doxygen comments