remove dependency on randomness and use worse standard rand()