fix f calculation