Working z alg.