Changed alg for X2