Fully parse inputfile. Modified functions to be able to fully read output files