implement binary search maximizer