exit from main() directly
break circular dependency
split into package
version number constant
rename variables
simplify loop counter
explicit limit variable
Python 3 compatibility
calculate exact range conditions and handle both search directions in one loop
merge code from function that's only called once
document algorithm
add setup.py
Cython optimizations
use SSE in inner loop if available
use multiple threads
bump version number