add docstring
fix coding style