Search array, with .find_index () with (item> 3, item <5);
Search queue with .find_index (item) with (item.var == var_n);