finishing p-values function