updated functions signatures
updated docstrings
reorganized imports
add countstat to  imports
docstring grammar fix