added the binary search