Thesis: algorithms section rewritten