changes to make it work in 2.6, 2.7, 3.2, and 3.3 python versions