huge speedup by using Python 2.7 feature

Used a feature of Python 2.7 to find the highest bit set of an integer.