made functional search function, still requires work