binary search with addition and substraction