Code cleanup.
Updated documentation.