comments translated, minor refactorings, pep8