made some changes to the f() calls within DOC so that it can read the extracted data with the outer f() function