almost finished with search functionality