Adding document functions.