Made some changes to the search. Last time it did not work. Now it works but the code is ugly and should be redone ASAP!