Finalize the logic of the search. Everything works fine now\!