fix code format according to PEP 8.
update docstrings according to PEP 257.