added proper docstrings for reducer.py