Update to the sweep algorithm.