Added search() function that returns the first match