worked on search function