make rand() function