Fully comment the library to explain how it works.