move docstrings to appropriate locations
pep8 fixes