This module may or may not be useful: [bisect](http://docs.python.org/2/library/bisect.html)