fixes random selct algo to account for all elems in arr