Fixed modulo not handleing negative values