fix the calculation