updates to hopefully work with python 3
mostly pep8 changes