Fix to error: use of undeclared identifier 'rand' & 'RAND_MAX'