Minor edits on algorithms