added level3 alg