document functions