added logic for PriorAll