added comments and clean up pep 8