Add documentation to internal functions