Added license information and docstrings.