Adjusted search to be more efficient