alg: various changes