Simplified the average priority calculationss