Revert "Revert "lib and doc""

This reverts commit 26b8e9739407c7fb4b4b6e040ba47ccd197d944d.
Revert "Revert "Revert "lib and doc"""

This reverts commit 582484793b80ea7196eecc1c5b8459f61e15ca8d.