Further simplify new algorithm.