use rand() because random() isn't available on windows