add integer rounding, but contains bug