added rand_name function