added new document function