Made formatting strings compatible with python 2.6

Also fixed styling according to pep8