add option to keep min p value