Add some documentation to explain how this all works.