make the script work under Python 3.
Make the code PEP8 compliant, at least according to the script I'm
using.