doc: improved documentation and fixed PEP8