Bisect.py working with both functions