Switch from `mod` to `rem` for a big performance boost.