Update and finish alg33