Corrected an alg