changed tf calculation