Cleaned up comments and updated documentation.