getRandNum now takes in num between 0 and length of element