fixing rounding errors