Expanded documentation significantly.