Simplifying the priority algorithm.