edited the converter function to accept a base directory for where to do file processing