get rand function added