Added a better random generator