Addressing comments and other cleanup to priority algorithm.