Using unbiased PRNG algorithm

rand.Next() % N is does not have unbiased probability in general;
rand.Next(N) is preferred.