Added the method to read files in input dirs.