Added mod(x, m) that considers sign of x