use bisect_right() instead of bisect_left() to find an index in a determination