Change random() to arc4random_uniform() to get rid of compiler warning.