set up search function (still needs finished)