Corrected an error in the algorithm 1.