Finished the search function.

I think. I need to test it, but I think it'll be OK.