doc: document about 50% of the code