fixed annoying off by 1 rounding error