added some doxygen, fixed compare method and introduced more tests