more aggressive algorithm for #441