modifying document.py