doing it for bisect