More documentation work. Expand the docstrings for core functions