Documented the code and functions.