Now using random() instead of the depricated rand()