Use arc4random instead of deprecated rand