fixed read_random_array_idx not working as intended ( calling an undef function and using wrong key for searching in dict