Added docstrings.
Minor changes.