Largely revised the documentation.