refactoring docs
added sphinx docstring to functions