fixed typos
added some end
added algorithm + cite
typo