Updated for new alg