implementing first search