Added caption to algorithm and fixed more typos