add documents and fix some small bugs