fixed around bugs that were seen around rand()