changed all rounding operations to round up to avoid clipping