doc functions