added dbar2 calculations, fixed P_f calculations