search function intial draft part 2