created a common getRand