fix remainder

fix remainder for equal values