Changed input/output, Created option for flat files