Subset alg impl