removed some of the if verbose statements and pep8ified most of the code