document requires function