Updated p-value calculation for prefixTree