Improve rand()