More documentation and some cleanup.