reorganization of arguments and pep8 clean up