change from alg.2 to alg.3