Added file parsing for input files, and function to determine whether a file is an input file or an output file.