stopped using 'rand() % n' for random numbers due to modulo bias. now uses randInt which stoppes this bias.