Finished rewriting the algorithm doc.