how to calculate remainder - Search