how to calculate a remainder - Search