Added reference.
Added docstrings.