Added document manipulation functions