Loops, rand, and conditionals