Fixes search algorithm to have more accurate results