Added some documentation to algorithm.h