more pep8 changes and a fix for proper use of the range function
another pep8 fix and a string substitution fix