add docstrings and fix some warnings by pylint