fixed lossesCalculation