fixes floating point math related troubles when calculating total