start of p_val processing