small refactoring, pep8, etc.
small refactoring 2
major refactoring (not perfect) closes #13