bisect for quarter finding