Modified Binary Search.