Added a routine to calculate kF