using binary search to find valid SLD