testing rand() and for loop)