added docstrings to meanfield