Working extraction algorithm