added code for parallel processing of multiple files