working on finishing search function