Add 'path_wd' argument to function
Use wd path specified in function call for reading files