fixed some rounding errors