search alg for the proper list