Changes to optimize code and some minor pep8 cleanup plus one change to README.rst.

Some minor code optimization plus a small change to README.rst