improve SF calculation