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