the random generator is in the constructor