typos and edited text on algorithms