ccw and binary search