Repositioned algorithm.