Added get random function