adding searchFunction (NOT COMPLETE)