Three different scenarios for update_doc function, issue #71