use random() instead of rand()