added is comparison and some pep 8 changes.
autopep8ed