Documented some of the functions and how they get called.