implemented first search function