Working new search function